﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Component
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.ComponentModel;
using System.Security;
using UnityEngine.Internal;
using UnityEngineInternal;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Base class for everything attached to a GameObject.</para>
  /// </summary>
  public class Component : Object
  {
    /// <summary>
    ///   <para>The Transform attached to this GameObject.</para>
    /// </summary>
    public   Transform transform {
      get
      {
        throw new NotImplementedException();
      } 
    }

    /// <summary>
    ///   <para>The game object this component is attached to. A component is always attached to a game object.</para>
    /// </summary>
    public   GameObject gameObject {
      get
      {
        throw new NotImplementedException();
      } 
    }
    /// <summary>
    ///   <para>The non-generic version of this method.</para>
    /// </summary>
    /// <param name="type">The type of Component to retrieve.</param>
    /// <returns>
    ///   <para>A Component of the matching type, otherwise null if no Component is found.</para>
    /// </returns>
    [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
    public Component GetComponent(System.Type type) => this.gameObject.GetComponent(type);


    internal void GetComponentFastPath(System.Type type, IntPtr oneFurtherThanResultValue)
    {
      throw new NotImplementedException();
    }

    [SecuritySafeCritical]
    public unsafe T GetComponent<T>()
    {
      CastHelper<T> castHelper = new CastHelper<T>();
      this.GetComponentFastPath(typeof (T), new IntPtr((void*) &castHelper.onePointerFurtherThanT));
      return castHelper.t;
    }

    [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
    public bool TryGetComponent(System.Type type, out Component component)
    {
      return this.gameObject.TryGetComponent(type, out component);
    }

    [SecuritySafeCritical]
    public bool TryGetComponent<T>(out T component)
    {
      return this.gameObject.TryGetComponent<T>(out component);
    }

    /// <summary>
    ///   <para>The string-based version of this method.</para>
    /// </summary>
    /// <param name="type">The name of the type of Component to get.</param>
    /// <returns>
    ///   <para>A Component of the matching type, otherwise null if no Component is found.</para>
    /// </returns>

    public Component GetComponent(string type)
    {
      throw new NotImplementedException();
    }

    /// <summary>
    ///   <para>This is the non-generic version of this method.</para>
    /// </summary>
    /// <param name="t">The type of component to search for.</param>
    /// <param name="includeInactive">Whether to include inactive child GameObjects in the search.</param>
    /// <returns>
    ///   <para>A Component of the matching type, otherwise null if no Component is found.</para>
    /// </returns>
    [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
    public Component GetComponentInChildren(System.Type t, bool includeInactive)
    {
      return this.gameObject.GetComponentInChildren(t, includeInactive);
    }

    /// <summary>
    ///   <para>This is the non-generic version of this method.</para>
    /// </summary>
    /// <param name="t">The type of component to search for.</param>
    /// <param name="includeInactive">Whether to include inactive child GameObjects in the search.</param>
    /// <returns>
    ///   <para>A Component of the matching type, otherwise null if no Component is found.</para>
    /// </returns>
    [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
    public Component GetComponentInChildren(System.Type t) => this.GetComponentInChildren(t, false);

    public T GetComponentInChildren<T>([UnityEngine.Internal.DefaultValue("false")] bool includeInactive)where T:Component
    {
      return (T) this.GetComponentInChildren(typeof (T), includeInactive);
    }

    [ExcludeFromDocs]
    public T GetComponentInChildren<T>()where T:Component => (T) this.GetComponentInChildren(typeof (T), false);

    /// <summary>
    ///   <para>The non-generic version of this method.</para>
    /// </summary>
    /// <param name="t">The type of component to search for.</param>
    /// <param name="includeInactive">Whether to include inactive child GameObjects in the search.</param>
    /// <returns>
    ///   <para>An array of all found components matching the specified type.</para>
    /// </returns>
    public Component[] GetComponentsInChildren(System.Type t, bool includeInactive)
    {
      return this.gameObject.GetComponentsInChildren(t, includeInactive);
    }

    [ExcludeFromDocs]
    public Component[] GetComponentsInChildren(System.Type t)
    {
      return this.gameObject.GetComponentsInChildren(t, false);
    }

    public T[] GetComponentsInChildren<T>(bool includeInactive)
    {
      return this.gameObject.GetComponentsInChildren<T>(includeInactive);
    }

    public void GetComponentsInChildren<T>(bool includeInactive, List<T> result)
    {
      this.gameObject.GetComponentsInChildren<T>(includeInactive, result);
    }

    public T[] GetComponentsInChildren<T>() => this.GetComponentsInChildren<T>(false);

    public void GetComponentsInChildren<T>(List<T> results)
    {
      this.GetComponentsInChildren<T>(false, results);
    }

    /// <summary>
    ///   <para>The non-generic version of this method.</para>
    /// </summary>
    /// <param name="t">The type of component to search for.</param>
    /// <param name="includeInactive">Whether to include inactive parent GameObjects in the search.</param>
    /// <returns>
    ///   <para>A Component of the matching type, otherwise null if no Component is found.</para>
    /// </returns>
    [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
    public Component GetComponentInParent(System.Type t, bool includeInactive)
    {
      return this.gameObject.GetComponentInParent(t, includeInactive);
    }

    /// <summary>
    ///   <para>The non-generic version of this method.</para>
    /// </summary>
    /// <param name="t">The type of component to search for.</param>
    /// <param name="includeInactive">Whether to include inactive parent GameObjects in the search.</param>
    /// <returns>
    ///   <para>A Component of the matching type, otherwise null if no Component is found.</para>
    /// </returns>
    [TypeInferenceRule(TypeInferenceRules.TypeReferencedByFirstArgument)]
    public Component GetComponentInParent(System.Type t)
    {
      return this.gameObject.GetComponentInParent(t, false);
    }

    public T GetComponentInParent<T>([UnityEngine.Internal.DefaultValue("false")] bool includeInactive)where T:Component
    {
      return (T) this.GetComponentInParent(typeof (T), includeInactive);
    }

    public T GetComponentInParent<T>()where T:Component => (T) this.GetComponentInParent(typeof (T), false);

    /// <summary>
    ///   <para>The non-generic version of this method.</para>
    /// </summary>
    /// <param name="t">The type of component to search for.</param>
    /// <param name="includeInactive">Whether to include inactive parent GameObjects in the search.</param>
    /// <returns>
    ///   <para>An array of all found components matching the specified type.</para>
    /// </returns>
    public Component[] GetComponentsInParent(System.Type t, [UnityEngine.Internal.DefaultValue("false")] bool includeInactive)
    {
      return this.gameObject.GetComponentsInParent(t, includeInactive);
    }

    [ExcludeFromDocs]
    public Component[] GetComponentsInParent(System.Type t) => this.GetComponentsInParent(t, false);

    public T[] GetComponentsInParent<T>(bool includeInactive)
    {
      return this.gameObject.GetComponentsInParent<T>(includeInactive);
    }

    public void GetComponentsInParent<T>(bool includeInactive, List<T> results)
    {
      this.gameObject.GetComponentsInParent<T>(includeInactive, results);
    }

    public T[] GetComponentsInParent<T>() => this.GetComponentsInParent<T>(false);

    /// <summary>
    ///   <para>The non-generic version of this method.</para>
    /// </summary>
    /// <param name="type">The type of component to search for.</param>
    /// <returns>
    ///   <para>An array containing all matching components of type type.</para>
    /// </returns>
    public Component[] GetComponents(System.Type type) => this.gameObject.GetComponents(type);


    private void GetComponentsForListInternal(System.Type searchType, object resultList)
    {
      throw new NotImplementedException();
    }

    public void GetComponents(System.Type type, List<Component> results)
    {
      this.GetComponentsForListInternal(type, (object) results);
    }

    public void GetComponents<T>(List<T> results)
    {
      this.GetComponentsForListInternal(typeof (T), (object) results);
    }

    /// <summary>
    ///   <para>The tag of this game object.</para>
    /// </summary>
    public string tag
    {
      get => this.gameObject.tag;
      set => this.gameObject.tag = value;
    }

    public T[] GetComponents<T>() => this.gameObject.GetComponents<T>();

    /// <summary>
    ///   <para>Checks the GameObject's tag against the defined tag.</para>
    /// </summary>
    /// <param name="tag">The tag to compare.</param>
    /// <returns>
    ///   <para>Returns true if GameObject has same tag. Returns false otherwise.</para>
    /// </returns>
    public bool CompareTag(string tag) => this.gameObject.CompareTag(tag);


    internal Component GetCoupledComponent()
    {
      throw new NotImplementedException();
    }


    internal bool IsCoupledComponent()
    {
      throw new NotImplementedException();
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.</para>
    /// </summary>
    /// <param name="methodName">Name of method to call.</param>
    /// <param name="value">Optional parameter value for the method.</param>
    /// <param name="options">Should an error be raised if the method does not exist on the target object?</param>
     
    public   void SendMessageUpwards(
      string methodName,
      [UnityEngine.Internal.DefaultValue("null")] object value,
      [UnityEngine.Internal.DefaultValue("SendMessageOptions.RequireReceiver")] SendMessageOptions options)
    {
      throw new NotImplementedException();
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.</para>
    /// </summary>
    /// <param name="methodName">Name of method to call.</param>
    /// <param name="value">Optional parameter value for the method.</param>
    /// <param name="options">Should an error be raised if the method does not exist on the target object?</param>
    [ExcludeFromDocs]
    public void SendMessageUpwards(string methodName, object value)
    {
      this.SendMessageUpwards(methodName, value, SendMessageOptions.RequireReceiver);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.</para>
    /// </summary>
    /// <param name="methodName">Name of method to call.</param>
    /// <param name="value">Optional parameter value for the method.</param>
    /// <param name="options">Should an error be raised if the method does not exist on the target object?</param>
    [ExcludeFromDocs]
    public void SendMessageUpwards(string methodName)
    {
      this.SendMessageUpwards(methodName, (object) null, SendMessageOptions.RequireReceiver);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.</para>
    /// </summary>
    /// <param name="methodName">Name of method to call.</param>
    /// <param name="value">Optional parameter value for the method.</param>
    /// <param name="options">Should an error be raised if the method does not exist on the target object?</param>
    public void SendMessageUpwards(string methodName, SendMessageOptions options)
    {
      this.SendMessageUpwards(methodName, (object) null, options);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="value">Optional parameter for the method.</param>
    /// <param name="options">Should an error be raised if the target object doesn't implement the method for the message?</param>
    public void SendMessage(string methodName, object value)
    {
      this.SendMessage(methodName, value, SendMessageOptions.RequireReceiver);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="value">Optional parameter for the method.</param>
    /// <param name="options">Should an error be raised if the target object doesn't implement the method for the message?</param>
    public void SendMessage(string methodName)
    {
      this.SendMessage(methodName, (object) null, SendMessageOptions.RequireReceiver);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="value">Optional parameter for the method.</param>
    /// <param name="options">Should an error be raised if the target object doesn't implement the method for the message?</param>
     
    public   void SendMessage(string methodName, object value, SendMessageOptions options)
    {
      throw new NotImplementedException();
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="value">Optional parameter for the method.</param>
    /// <param name="options">Should an error be raised if the target object doesn't implement the method for the message?</param>
    public void SendMessage(string methodName, SendMessageOptions options)
    {
      this.SendMessage(methodName, (object) null, options);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object or any of its children.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="parameter">Optional parameter to pass to the method (can be any value).</param>
    /// <param name="options">Should an error be raised if the method does not exist for a given target object?</param>
     
    public   void BroadcastMessage(
      string methodName,
      [UnityEngine.Internal.DefaultValue("null")] object parameter,
      [UnityEngine.Internal.DefaultValue("SendMessageOptions.RequireReceiver")] SendMessageOptions options)
    {
      throw new NotImplementedException();
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object or any of its children.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="parameter">Optional parameter to pass to the method (can be any value).</param>
    /// <param name="options">Should an error be raised if the method does not exist for a given target object?</param>
    [ExcludeFromDocs]
    public void BroadcastMessage(string methodName, object parameter)
    {
      this.BroadcastMessage(methodName, parameter, SendMessageOptions.RequireReceiver);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object or any of its children.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="parameter">Optional parameter to pass to the method (can be any value).</param>
    /// <param name="options">Should an error be raised if the method does not exist for a given target object?</param>
    [ExcludeFromDocs]
    public void BroadcastMessage(string methodName)
    {
      this.BroadcastMessage(methodName, (object) null, SendMessageOptions.RequireReceiver);
    }

    /// <summary>
    ///   <para>Calls the method named methodName on every MonoBehaviour in this game object or any of its children.</para>
    /// </summary>
    /// <param name="methodName">Name of the method to call.</param>
    /// <param name="parameter">Optional parameter to pass to the method (can be any value).</param>
    /// <param name="options">Should an error be raised if the method does not exist for a given target object?</param>
    public void BroadcastMessage(string methodName, SendMessageOptions options)
    {
      this.BroadcastMessage(methodName, (object) null, options);
    }

    /// <summary>
    ///   <para>The Rigidbody attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [Obsolete("Property rigidbody has been deprecated. Use GetComponent<Rigidbody>() instead. (UnityUpgradable)", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public Component rigidbody
    {
      get => throw new NotSupportedException("rigidbody property has been deprecated");
    }

    /// <summary>
    ///   <para>The Rigidbody2D that is attached to the Component's GameObject.</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property rigidbody2D has been deprecated. Use GetComponent<Rigidbody2D>() instead. (UnityUpgradable)", true)]
    public Component rigidbody2D
    {
      get => throw new NotSupportedException("rigidbody2D property has been deprecated");
    }

    /// <summary>
    ///   <para>The Camera attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [Obsolete("Property camera has been deprecated. Use GetComponent<Camera>() instead. (UnityUpgradable)", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public Component camera
    {
      get => throw new NotSupportedException("camera property has been deprecated");
    }

    /// <summary>
    ///   <para>The Light attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property light has been deprecated. Use GetComponent<Light>() instead. (UnityUpgradable)", true)]
    public Component light => throw new NotSupportedException("light property has been deprecated");

    /// <summary>
    ///   <para>The Animation attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [Obsolete("Property animation has been deprecated. Use GetComponent<Animation>() instead. (UnityUpgradable)", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public Component animation
    {
      get => throw new NotSupportedException("animation property has been deprecated");
    }

    /// <summary>
    ///   <para>The ConstantForce attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property constantForce has been deprecated. Use GetComponent<ConstantForce>() instead. (UnityUpgradable)", true)]
    public Component constantForce
    {
      get => throw new NotSupportedException("constantForce property has been deprecated");
    }

    /// <summary>
    ///   <para>The Renderer attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property renderer has been deprecated. Use GetComponent<Renderer>() instead. (UnityUpgradable)", true)]
    public Component renderer
    {
      get => throw new NotSupportedException("renderer property has been deprecated");
    }

    /// <summary>
    ///   <para>The AudioSource attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property audio has been deprecated. Use GetComponent<AudioSource>() instead. (UnityUpgradable)", true)]
    public Component audio => throw new NotSupportedException("audio property has been deprecated");

    /// <summary>
    ///   <para>The NetworkView attached to this GameObject (Read Only). (null if there is none attached).</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property networkView has been deprecated. Use GetComponent<NetworkView>() instead. (UnityUpgradable)", true)]
    public Component networkView
    {
      get => throw new NotSupportedException("networkView property has been deprecated");
    }

    /// <summary>
    ///   <para>The Collider attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [Obsolete("Property collider has been deprecated. Use GetComponent<Collider>() instead. (UnityUpgradable)", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public Component collider
    {
      get => throw new NotSupportedException("collider property has been deprecated");
    }

    /// <summary>
    ///   <para>The Collider2D component attached to the object.</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property collider2D has been deprecated. Use GetComponent<Collider2D>() instead. (UnityUpgradable)", true)]
    public Component collider2D
    {
      get => throw new NotSupportedException("collider2D property has been deprecated");
    }

    /// <summary>
    ///   <para>The HingeJoint attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [Obsolete("Property hingeJoint has been deprecated. Use GetComponent<HingeJoint>() instead. (UnityUpgradable)", true)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public Component hingeJoint
    {
      get => throw new NotSupportedException("hingeJoint property has been deprecated");
    }

    /// <summary>
    ///   <para>The ParticleSystem attached to this GameObject. (Null if there is none attached).</para>
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    [Obsolete("Property particleSystem has been deprecated. Use GetComponent<ParticleSystem>() instead. (UnityUpgradable)", true)]
    public Component particleSystem
    {
      get => throw new NotSupportedException("particleSystem property has been deprecated");
    }
  }
}
